package com.bw.churu.controller;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.bw.churu.domain.Passageway;
import com.bw.churu.service.PassagewayService;
import com.bw.churu.units.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/chu")
public class ChuruController {
    @Autowired
    private PassagewayService passagewayService;
    @RequestMapping("/chulist")
    public List<Passageway> chu(){
        LambdaQueryWrapper<Passageway> passagewayLambdaQueryWrapper = new LambdaQueryWrapper<>();
        passagewayLambdaQueryWrapper.eq(Passageway::getStatus,0);
        List<Passageway> chulist = passagewayService.list(passagewayLambdaQueryWrapper);
        return chulist;
    }
    @RequestMapping("/rulist")
    public List<Passageway> ru(){
        LambdaQueryWrapper<Passageway> passagewayLambdaQueryWrapper = new LambdaQueryWrapper<>();
        passagewayLambdaQueryWrapper.eq(Passageway::getStatus,1);
        List<Passageway> list = passagewayService.list(passagewayLambdaQueryWrapper);
        return list;
    }
}
